package my.spring.aop.pointcut;

import my.spring.aop.pointcut.method.AnnotationMethodMatcher;
import my.spring.aop.pointcut.method.MethodMatcher;

import java.lang.annotation.Annotation;

/**
 * Pointcut的注解版本实现
 * @author fengbo
 * @date 2018/6/30
 */
public class AnnotationMatchingPointcut implements Pointcut {

    private final MethodMatcher methodMatcher;

    public AnnotationMatchingPointcut(Class<? extends Annotation> annotationType) {
        methodMatcher = new AnnotationMethodMatcher(annotationType);
    }

    @Override
    public MethodMatcher getMethodMatcher() {
        return methodMatcher;
    }
}
